﻿//#ZEEVIN#跟分页没有关系
//#ZEEVIN#筛选条件
var screenning_where="";
//#ZEEVIN#记录是否获取结束
var screenning_over=false;
function datefun()
{
	screenning_radiofunction(0,0,4);
}
function screenning_radiofunction(gid,id,type){
	   //#ZEEVIN#界面显示操作
	   if(type==1){
	       if(id==0){
		      $("#raid_"+gid+"_0").attr("checked",true);
		      $("input[id^='chk_"+gid+"_']").attr("checked",false);
		   }else{
		      $("#raid_"+gid+"_0").attr("checked",false);
		      $("#chk_"+gid+"_"+id).attr("checked",!$("#chk_"+gid+"_"+id).attr("checked"));
		      if($("input[id^='chk_"+gid+"_']:checked").size()==0){
		         $("#raid_"+gid+"_0").attr("checked",true);
		      }
		   }
	   }else if(type==0){
	       if(id==0){
	          $("#raid_"+gid+"_0").attr("checked",true);
		      $("input[id^='chk_"+gid+"_']").attr("checked",false);
		   }else{
		      $("#raid_"+gid+"_0").attr("checked",false);
		      if($("input[id^='chk_"+gid+"_']:checked").size()==0){
		        $("#raid_"+gid+"_0").attr("checked",true);
		      }
		   }
	   }else if(type==3){
	       $("#raid_"+gid+"_"+id).attr("checked",true);
	   }
	   
	  //#ZEEVIN#获取选中的值
	   var str="";
	   $("#mysearchsort ul").each(function(m){
	        var _s="";
	        var _key=$(this).find("input:eq(0)").val();
	        if($(this).find("input[id^='chk_']:checked").size()>0){
	           $(this).find("input[id^='chk_']:checked").each(function(n){
	              _s+="&"+_key+"="+$(this).val();
	           });
	        }
	        str+=_s;
	   });
	   
   
	   //#ZEEVIN#时间取值
	   if($("#mysearchsort ul input[name='ratime']").size()){
	       var _checkedid=$("#mysearchsort ul input[name='ratime']:checked").attr("id");
	       var _tstr="时间";
	       if(_checkedid!="raid_1_0"){
	          if(_checkedid!="raid_1_"+($("#mysearchsort ul input[name='ratime']").size()-1)){
	             str+="&"+_tstr+"="+$("#"+_checkedid).val();
	          }else{
	             str+="&"+_tstr+"="+$("#stdate").val()+"&"+_tstr+"="+$("#endate").val();
	          }
	       }
	   }
	   //#ZEEVIN#时间排序
	   if($("#mysearchsort ul input[name='ratimesort']").size()){
	       str+="&datesort="+$("#mysearchsort ul input[name='ratimesort']:checked").val();
	   }

   
   //#ZEEVIN#判断
   if(str.length!=""){
     if(screenning_where!=str){
        //#ZEEVIN#新筛选
        screenning_where=str;
        screenning_over=false;
        pageno=1;
        scrolltype=2;
        screenning_search_getdata();
     }
  }else{
     if(screenning_where!=str){
        //#ZEEVIN#原始数据
        pageno=1;
        screenning_where="";
        screenning_over=false;
        scrolltype=2;
        screenning_search_getdata();
     }
  }
}



//#ZEEVIN#重新加载记录
function screenning_search_getdata() {
    alert(screenning_where);
}